# apps/users/urls.py
from django.urls import path
from rest_framework.routers import DefaultRouter

from users.views import ImageVerifyView, UserViewSet, MyTokenObtainPairView, AreaViewSet, AddressViewSet

urlpatterns = [
    path('verification/<str:func>/<uuid:uuid>/', ImageVerifyView.as_view()),
    path('login/', MyTokenObtainPairView.as_view()),
    path('register/', UserViewSet.as_view({"post": "create"})),
    # 添加短信验证码接口
    path('send_sms_code/', UserViewSet.as_view({"post": "send_sms_code"})),
]

# 创建路由器
router = DefaultRouter()
router.register("users", UserViewSet)
router.register("area", AreaViewSet)
router.register("address", AddressViewSet)
urlpatterns += router.urls


